package com.kuaiyan.sdkshell.menu;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;

import com.kuaiyan.sdkshell.R;
import com.wmcsk.KuaiyanMenuWealSdk;
import com.wmcsk.interfaces.MenuAddListener;

public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_menu);
        final LinearLayout linearLayout = (LinearLayout)findViewById(R.id.menu);
        KuaiyanMenuWealSdk.getInstance().addMenuLayout(this, new MenuAddListener() {
            @Override
            public void loadError(int i, String s, Exception e) {
                Log.e("MainActivity",s);
            }
            @Override
            public void loadSuccess(View view) {
                linearLayout.addView(view);
            }
            @Override
            public boolean cacheInLocal() {
                return false;
            }
        });
    }
}
